<html><head><link href="stylesheets/program.css" rel="stylesheet" title="program" type="text/css" /> <title>Source file</title></head><body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000"><font size="2"><pre><div class="schemedoc-abstract-comment">;;;; .title SchemeDoc Demo
;;;; .author Kurt Normark
;;;; .affiliation Aalborg University, Denmark
;;;; This is a brief example of a Scheme program with multi-semicolon SchemeDoc comments.
;;;; We have used this example in the paper "Scheme Documentation tools". Here the example
;;;; is used to illustrate the use of different CSS stylesheets.</div>
<div class="schemedoc-section-comment">;;; Factorials. 
;;; .section-id fac-stuff
;;; This section demonstrates a plain and well-known function, namely the factorial function.</div>
<a name="fac"></a><div class="schemedoc-definition-comment">;; The factorial function. Also known as n! The factorial function multiplies the numbers from 1 to n.
;; .parameter n An integer
;; .pre-condition n &gt;= 0
;; .returns n * (n-1) * ... * 1</div><a name="fac"></a><span><a href="../dark-green.html#fac"><img src="./images/small-prev.gif" title="SchemeDoc Manual entry" alt="" border="0" /></a> <br /></span>(<a class="scheme-syntax-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_7.html#IDX173" title="R5RS Scheme form">define</a> <span class="signature">(fac n)</span>
 (<a class="scheme-syntax-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_6.html#IDX103" title="R5RS Scheme form">if</a> (<a class="scheme-procedure-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_8.html#IDX235" title="R5RS Scheme form">=</a> n 0) 1 (<a class="scheme-procedure-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_8.html#IDX250" title="R5RS Scheme form">*</a> n (<a class="applied-name" href="dark-green-1.html#fac" title="dark-green">fac</a> (<a class="scheme-procedure-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_8.html#IDX251" title="R5RS Scheme form">-</a> n 1)))))

<div class="schemedoc-section-comment">;;; List selection functions.
;;; .section-id list-stuff
;;; This section demonstrates two aliased functions.</div>
<a name="head"></a><div class="schemedoc-definition-comment">;; An alias of car. 
;; .returns The first component of a cons cell
;; .form (head pair)
;; .parameter pair A cons cell</div><a name="head"></a><span><a href="../dark-green.html#head"><img src="./images/small-prev.gif" title="SchemeDoc Manual entry" alt="" border="0" /></a> <br /></span>(<a class="scheme-syntax-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_7.html#IDX173" title="R5RS Scheme form">define</a> <span class="signature">head</span> <a class="scheme-procedure-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_8.html#IDX321" title="R5RS Scheme form">car</a>)

<a name="tail"></a><div class="schemedoc-definition-comment">;; An alias of cdr.
;; .returns The second component of a cons cell
;; .form (tail pair)
;; .parameter pair A cons cell</div><a name="tail"></a><span><a href="../dark-green.html#tail"><img src="./images/small-prev.gif" title="SchemeDoc Manual entry" alt="" border="0" /></a> <br /></span>(<a class="scheme-syntax-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_7.html#IDX173" title="R5RS Scheme form">define</a> <span class="signature">tail</span> <a class="scheme-procedure-name" href="http://www.cs.aau.dk/~normark/scheme/distribution/laml/r5rs/r5rs_8.html#IDX322" title="R5RS Scheme form">cdr</a>)
</pre></font><div>&nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p> &nbsp; <p></p></div></body></html>